<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Section 4.24.&nbsp; Summary of File Access Permission Bits</title>
<link rel="STYLESHEET" type="text/css" href="images/style.css">
<link rel="STYLESHEET" type="text/css" href="images/docsafari.css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/team.gif" width="60" height="17" border="0" align="absmiddle"  alt="Team BBL"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=ch04lev1sec23.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<a href=ch04lev1sec25.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
<br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top"><a name="ch04lev1sec24"></a>
<h3 class="docSection1Title">4.24. Summary of File Access Permission Bits</h3>
<p class="docText"><a name="idd1e33316"></a><a name="idd1e33321"></a><a name="idd1e33326"></a><a name="idd1e33331"></a><a name="idd1e33336"></a><a name="idd1e33339"></a><a name="idd1e33342"></a><a name="idd1e33345"></a><a name="idd1e33350"></a><a name="idd1e33355"></a><a name="idd1e33360"></a><a name="idd1e33365"></a><a name="idd1e33370"></a><a name="idd1e33375"></a><a name="idd1e33380"></a><a name="idd1e33385"></a><a name="idd1e33390"></a><a name="idd1e33395"></a><a name="idd1e33400"></a><a name="idd1e33405"></a><a name="idd1e33410"></a><a name="idd1e33415"></a><a name="idd1e33418"></a>We've covered all the file access permission bits, some of which serve multiple purposes. <a class="docLink" href="#ch04fig26">Figure 4.26</a> summarizes all these permission bits and their interpretation when applied to a regular file and a directory.</P>
<a name="ch04fig26"></a><P><table cellspacing="0" class="allBorders" border="1" RULES="groups" cellpadding="5"><caption><h5 class="docTableTitle">Figure 4.26. Summary of file access permission bits</H5></caption><colgroup><col width="80"><col width="90"><col width="170"><col width="170"></colgroup><thead><TR><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Constant</span></P></th><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Description</span></p></th><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Effect on regular file</span></P></th><th class="bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Effect on directory</span></P></th></TR></thead><tr><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>S_ISUID</tt></p></TD><TD class="rightBorder" align="left" valign="top"><p class="docText">set-user-ID</P></td><TD class="rightBorder" align="left" valign="top"><p class="docText">set effective user ID on execution</P></td><TD class="docTableCell" align="left" valign="top"><p class="docText">(not used)</P></td></tr><tr><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText"><tt>S_ISGID</tt></P></td><TD class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">set-group-ID</p></TD><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">if group-execute set then set effective group ID on execution; otherwise enable mandatory record locking (if supported)</p></td><td class="bottomBorder" align="left" valign="top"><p class="docText">set group ID of new files created in directory to group ID of directory</p></td></tr><tr><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText"><tt>S_ISVTX</tt></p></td><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">sticky bit</p></td><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">control caching of file contents (if supported)</p></td><TD class="bottomBorder" align="left" valign="top"><p class="docText">restrict removal and renaming of files in directory</P></td></TR><TR><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>S_IRUSR</tt></p></TD><TD class="rightBorder" align="left" valign="top"><p class="docText">user-read</P></td><TD class="rightBorder" align="left" valign="top"><p class="docText">user permission to read file</p></TD><TD class="docTableCell" align="left" valign="top"><p class="docText">user permission to read directory entries</P></td></TR><TR><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>S_IWUSR</tt></P></TD><td class="rightBorder" align="left" valign="top"><p class="docText">user-write</p></td><td class="rightBorder" align="left" valign="top"><p class="docText">user permission to write file</P></td><TD class="docTableCell" align="left" valign="top"><p class="docText">user permission to remove and create files in directory</p></TD></tr><tr><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText"><tt>S_IXUSR</tt></p></td><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">user-execute</p></td><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">user permission to execute file</p></td><td class="bottomBorder" align="left" valign="top"><p class="docText">user permission to search for given pathname in directory</p></td></tr><tr><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>S_IRGRP</tt></P></TD><td class="rightBorder" align="left" valign="top"><p class="docText">group-read</P></TD><TD class="rightBorder" align="left" valign="top"><p class="docText">group permission to read file</p></TD><TD class="docTableCell" align="left" valign="top"><p class="docText">group permission to read directory entries</P></td></TR><tr><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>S_IWGRP</tt></P></TD><td class="rightBorder" align="left" valign="top"><p class="docText">group-write</P></TD><td class="rightBorder" align="left" valign="top"><p class="docText">group permission to write file</P></TD><td class="docTableCell" align="left" valign="top"><p class="docText">group permission to remove and create files in directory</p></td></tr><TR><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText"><tt>S_IXGRP</tt></P></td><TD class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">group-execute</p></td><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">group permission to execute file</p></td><td class="bottomBorder" align="left" valign="top"><p class="docText">group permission to search for given pathname in directory</p></td></tr><tr><td class="rightBorder" align="left" valign="top"><p class="docText"><tt>S_IROTH</tt></p></td><td class="rightBorder" align="left" valign="top"><p class="docText">other-read</p></td><td class="rightBorder" align="left" valign="top"><p class="docText">other permission to read file</P></TD><td class="docTableCell" align="left" valign="top"><p class="docText">other permission to read directory entries</P></TD></TR><tr><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>S_IWOTH</tt></P></TD><td class="rightBorder" align="left" valign="top"><p class="docText">other-write</P></td><TD class="rightBorder" align="left" valign="top"><p class="docText">other permission to write file</P></TD><td class="docTableCell" align="left" valign="top"><p class="docText">other permission to remove and create files in directory</P></TD></tr><TR><TD class="rightBorder" align="left" valign="top"><p class="docText"><tt>S_IXOTH</tt></p></td><td class="rightBorder" align="left" valign="top"><p class="docText">other-execute</p></TD><td class="rightBorder" align="left" valign="top"><p class="docText">other permission to execute file</P></td><TD class="docTableCell" align="left" valign="top"><p class="docText">other permission to search for given pathname in directory</p></td></tr></table></p><br>
<p class="docText">The final nine constants can also be grouped into threes, since</p>

<pre>
      S_IRWXU = S_IRUSR | S_IWUSR | S_IXUSR
      S_IRWXG = S_IRGRP | S_IWGRP | S_IXGRP
      S_IRWXO = S_IROTH | S_IWOTH | S_IXOTH
</pre><br>


<ul></ul></td></tr></table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/team.gif" width="60" height="17" border="0" align="absmiddle"  alt="Team BBL"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=ch04lev1sec23.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<a href=ch04lev1sec25.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
</body></html><br>
<table width="100%" cellspacing="0" cellpadding="0"
style="margin-top: 0pt; border-collapse: collapse;"> 
<tr> <td align="right" style="background-color=white; border-top: 1px solid gray;"> 
<a href="http://www.zipghost.com/" target="_blank" style="font-family: Tahoma, Verdana;
 font-size: 11px; text-decoration: none;">The CHM file was converted to HTM by Trial version of <b>ChmD<!--122-->ecompiler</b>.</a>
</TD>
</TR><tr>
<td align="right" style="background-color=white; "> 
<a href="http://www.etextwizard.com/download/cd/cdsetup.exe" target="_blank" style="font-family: Tahoma, Verdana;
 font-size: 11px; text-decoration: none;">Download <b>ChmDec<!--122-->ompiler</b> at: http://www.zipghost.com</a>
</TD></tr></table>
